<template>
  <div class="pa-3">
    <h3>{{ course.name }}</h3>
    <v-select
      :items="course.episodes.map((e) => ({ text: e.name, value: e._id }))"
    ></v-select>
    {{ course }}
  </div>
</template>

<script>
export default {
  async asyncData({ params, $axios }) {
    const { id } = params
    const course = await $axios.$get(`courses/${id}`, {
      // TODO edisodes查不出来
      params: {
        query: { populate: 'episodes' },
      },
    })
    return {
      id,
      course,
    }
  },
}
</script>

<style scoped></style>
